<style lang="less">
  .card_style {
    height: 100%;
    width: 100%;
    overflow: hidden;
    .ivu-card-body {
      padding: 0px;
    }
  }
  .page_style {
    margin-top: 10px;
    text-align: right;
  }
  .bench_search {
    margin-bottom: 10px;
  }
  .item1 {
    height: 42px;
    line-height: 40px;
  }
</style>
<template>
  <Card class="card_style" :bordered="false" :dis-hover="true">
    <Tabs :animated="false" @on-click="clickTabs" v-model="tabIndex">
      <TabPane label="事项设置">
        <Row class="bench_search">
          <Col span="6">
            <span>业务编号：</span>
            <Input style="width: 70%;" v-model="searchInfo.Row_ID"/>
          </Col>
          <Col span="6" offset="1">
            <span>事项名称：</span>
            <Input style="width: 70%;" v-model="searchInfo.QL_NAME"/>
          </Col>
          <Button type="info" @click="searchData(false)">
            <Icon type="ios-search"/> 搜索
          </Button>
          <Modal v-model="modal" title="编辑基本信息" width="700" cancel-text="关闭" @on-ok="Edit(paramData)"
          @on-cancel="modal = false" ok-text="确定" style="position:relative;">
            <Form ref="paramData" :model="paramData">
              <Row class="item1">
                <Col span="5" style="text-align: center" class="">业务编号:</Col>
                <Col span="12">
                  <Input v-model="paramData.Row_ID" disabled placeholder=""></Input>
                </Col>
              </Row>
              <Row class="item1" style="height:auto;">
                <Col span="5" style="text-align: center" class="">事项名称:</Col>
                <Col span="12">
                  <Input v-model="paramData.QL_NAME" placeholder=""></Input>
                </Col>
              </Row>
              <Row class="item1" style="height: auto">
                <Col span="5" style="text-align: center" class="">文件:</Col>
                <Col span="12">
                  <!--<Input v-model="paramData.FILEURL" disabled style="width: 75%;margin-right: 5px;" placeholder=""></Input>-->
                  <Upload action="//txy.juyouhx.com/Api/Api/ObjectToOss/" :format="['pdf','jpg','jpeg','png','doc','docx']"
                  :max-size="10240" :on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
                  style="display: inline-block" :on-success="uploadFile">
                    <Button icon="ios-cloud-upload-outline">上传</Button>
                  </Upload>
                </Col>
              </Row>
              <Row class="item1">
                <Col span="5" style="text-align: center" class="">办事类型:</Col>
                <Col span="12">
                  <Select v-model="paramData.service_type" clearable style="width:200px">
                    <Option v-for="item in serviceTypeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
                  </Select>
                </Col>
              </Row>
              <Row class="item1">
                <Col span="5" style="text-align: center" class="">流程组ID:</Col>
                <Col span="12">
                  <Input v-model="paramData.process_group_id" placeholder=""></Input>
                </Col>
              </Row>
              <Row class="item1" style="height: auto;">
                <Col span="5" style="text-align: center" class="">标签:</Col>
                <Col span="18">
                 <Select v-model="count" multiple style="width:260px">
                    <Option value="群众">群众</Option>
                    <Option value="共产党员">共产党员</Option>
                    <Option value="共产主义青年团团员">共产主义青年团团员</Option>
                    <Option value="国民党革命委员会会员">国民党革命委员会会员</Option>
                    <Option value="民主同盟盟员">民主同盟盟员</Option>
                    <Option value="民主建国会会员">民主建国会会员</Option>
                    <Option value="民主促进会会员">民主促进会会员</Option>
                    <Option value="农工民主党党员">农工民主党党员</Option>
                    <Option value="致公党党员">致公党党员</Option>
                    <Option value="九三学社社员">九三学社社员</Option>
                    <Option value="台湾民主自治同盟盟员">台湾民主自治同盟盟员</Option>
                    <Option value="无党派民主人士">无党派民主人士</Option>
                    <Option value="低保家庭">低保家庭</Option>
                    <Option value="保障房家庭">保障房家庭</Option>
                    <Option value="残疾人">残疾人</Option>
                    <Option value="优抚对象">优抚对象</Option>
                    <Option value="高龄老人">高龄老人</Option>
                    <Option value="空巢老人">空巢老人</Option>
                    <Option value="留守儿童">留守儿童</Option>
                    <Option value="大病人群">大病人群</Option>
                    <Option value="奖扶特扶人群">奖扶特扶人群</Option>
                    <Option value="独生子女补助人群">独生子女补助人群</Option>
                    <Option value="失业人员">失业人员</Option>
                    <Option value="沈阳市">沈阳市</Option>
                    <Option value="男">男</Option>
                    <Option value="女">女</Option>
                  </Select>
                </Col>
              </Row>
            </Form>
          </Modal>
          <Modal v-model="modal1" title="详情" width="700" cancel-text="关闭"
          @on-cancel="modal = false" ok-text="确定" style="position:relative;">
            <Form ref="paramData" :model="paramData">
              <Row class="item1">
                <Col span="6" style="text-align: right" class="">业务编号:</Col>
                <Col span="12" offset="1">{{paramData.Row_ID}}</Col>
              </Row>
              <Row class="item1" style="height:auto;">
                <Col span="6" style="text-align: right" class="">事项名称:</Col>
                <Col span="12" offset="1">{{paramData.QL_NAME}}</Col>
              </Row>
              <Row class="item1" style="height:auto;">
                <Col span="6" style="text-align: right" class="">文件路径:</Col>
                <Col span="12" style="overflow: auto;line-height: normal;" offset="1">{{paramData.FILEURL}}</Col>
              </Row>
              <Row class="item1">
                <Col span="6" style="text-align: right" class="">办事类型:</Col>
                <Col span="12" offset="1">{{paramData.service_type | type_cn }}</Col>
              </Row>
              <Row class="item1">
                <Col span="6" style="text-align: right" class="">流程组ID:</Col>
                <Col span="12" offset="1">{{paramData.process_group_id}}</Col>
              </Row>
            </Form>
          </Modal>
          <Modal v-model="modal2" title="PDF" width="800" cancel-text="关闭"
          @on-cancel="modal2 = false" ok-text="确定" style="position:relative;">
            <Form label-position="right" :label-width="100">
              <Row>
                <Col span="24" class="ivu-form-item-content" style="text-align: center">
                  <embed width="750" height="600" :src="paramskImg"></embed>
                </Col>
              </Row>
            </Form>
          </Modal>
        </Row>
        <Table border :columns="columns1" :data="datalist"></Table>
        <Page :total="totalnum" :current="currentPageNo" :page-size="currentPageSize" @on-change="change" class="page_style"/>
      </TabPane>
      <TabPane label="电子证照更新">
        <Row class="bench_search">
          <Col span="6">
            <span>社区账号：</span>
            <Input style="width: 70%;" v-model="searchInfo.company_code1"/>
          </Col>
          <Col span="6" offset="1">
            <span>社区名称：</span>
            <Input style="width: 70%;" v-model="searchInfo.issue_unitname1"/>
          </Col>
          <Button type="info" @click="searchData1(false)">
            <Icon type="ios-search"/> 搜索
          </Button>
        </Row>
        <Table border :columns="columns2" :data="datalist2"></Table>
        <Modal v-model="visaModal" title="更新社区电子证照" width="700" cancel-text="关闭" ok-text="确定"
        @on-ok="updateVisaInfo(paramData1)" @on-cancel="visaModal = false" style="position:relative;">
          <Form ref="paramData1" :model="paramData1">
            <Row class="item1">
              <Col span="5" style="text-align: center" class="">社区账号:</Col>
              <Col span="12">
                <Input v-model="paramData1.company_code"></Input>
              </Col>
            </Row>
          </Form>
        </Modal>
      </TabPane>
      <TabPane label="配置医保账号">
        <Row class="bench_search">
          <Col span="6">
            <span>社区账号：</span>
            <Input style="width: 70%;" v-model="searchInfo.company_code2"/>
          </Col>
          <Col span="6" offset="1">
            <span>社区名称：</span>
            <Input style="width: 70%;" v-model="searchInfo.sqmc2"/>
          </Col>
          <Button type="info" @click="searchData2(false)">
            <Icon type="ios-search"/> 搜索
          </Button>
        </Row>
        <Table border :columns="columns3" :data="datalist3"></Table>
        <Modal v-model="yibaoModal" title="配置医保账号" width="700" cancel-text="关闭" ok-text="确定"
        @on-ok="updateYibaoInfo(paramData2)" @on-cancel="visaModal = false" style="position:relative;">
          <Form ref="paramData2" :model="paramData2">
            <Row class="item1">
              <Col span="5" style="text-align: center" class="">社区账号:</Col>
              <Col span="12">
                <Input v-model="paramData2.company_code"></Input>
              </Col>
            </Row>
          </Form>
        </Modal>
      </TabPane>
      <TabPane label="配置人社账号">
        <Row class="bench_search">
          <Col span="6">
            <span>社区账号：</span>
            <Input style="width: 70%;" v-model="searchInfo.company_code2"/>
          </Col>
          <Col span="6" offset="1">
            <span>社区名称：</span>
            <Input style="width: 70%;" v-model="searchInfo.sqmc2"/>
          </Col>
          <Button type="info" @click="searchData4(false)">
            <Icon type="ios-search"/> 搜索
          </Button>
        </Row>
        <Table border :columns="columns5" :data="datalist5"></Table>
        <Modal v-model="rensheModal" title="配置人社账号" width="700" cancel-text="关闭" ok-text="确定"
               @on-ok="updateRensheInfo(paramData3)" @on-cancel="visaModal = false" style="position:relative;">
          <Form ref="paramData2" :model="paramData3">
            <Row class="item1">
              <Col span="5" style="text-align: center" class="">社区账号:</Col>
              <Col span="12">
                <Input v-model="paramData3.company_code"></Input>
              </Col>
            </Row>
          </Form>
        </Modal>
      </TabPane>
      <TabPane label="事项更新">
        <Row class="bench_search">
          <Col span="6">
            <span>事项名称：</span>
            <Input style="width: 70%;" v-model="searchInfo.ql_name3"/>
          </Col>
          <Button type="info" @click="searchData3">
            <Icon type="ios-search"/> 搜索
          </Button>
        </Row>
        <Table border :columns="columns4" :data="datalist4">
          <template slot-scope="{ row }" slot="name">
            <span v-if="row.item_code">{{ row.ql_name }}</span>
            <span v-else>{{ row.ql_name_new }}</span>
          </template>
        </Table>
        <Modal v-model="itemupdateModal" title="事项信息对比" width="1000">
          <Table :columns="columnsCompare" :data="itemInfoAll">
            <template slot-scope="{ row }" slot="compareNew">
              <span v-if="typeof row.new === 'object'">
                <p v-for="item in row.new" v-bind:key="item.name">
                  {{item.name}}({{item.necessary=='1'?'必填':'非必填'}})
                </p>
              </span>
              <span v-else>{{ row.new }}</span>
            </template>
            <template slot-scope="{ row }" slot="compareOld">
              <span v-if="typeof row.old === 'object'">
                <p v-for="item in row.old" v-bind:key="item.name">
                  {{item.name}}({{item.necessary=='1'?'必填':'非必填'}})
                </p>
              </span>
              <span v-else>{{ row.old }}</span>
            </template>
          </Table>
          <div slot="footer">
            <Button type="success" @click="updateItemInfo(itemInfoAll, true)">更新</Button>
            <Button type="error" @click="itemupdateModal=false">关闭</Button>
          </div>
        </Modal>
      </TabPane>
    </Tabs>
  </Card>
</template>

<script>
import { itemList, saveItem, visalist, updateVisa, yibaoList, updateYibao,
  itemUpdateList, getItemUpdateInfo, updateItem, rensheList, updateRenshe } from '@/api/eventlist'

export default {
  data () {
    return {
      // file: null,
      // loadingStatus: false,
      tabIndex: 0,
      modal: false,
      modal1: false,
      modal2: false,
      visaModal: false,
      yibaoModal: false,
      rensheModal: false,
      itemupdateModal: false,
      // 事项配置的pdf链接
      paramskImg: '',
      searchInfo: {},
      // 电子证照配置项
      paramData1: {},
      // 医保配置项
      paramData2: {},
      // 人设配置项
      paramData3: {},
      // 事项信息配置
      paramData: {
        Row_ID: '',
        QL_NAME: '',
        FILEURL: '',
        service_type: '',
        process_group_id: ''
      },
      serviceTypeList: [
        { value: 'general', label: '通办' },
        { value: 'internet', label: '网办' },
        { value: 'seal', label: '盖章证明' }
      ],
      totalnum: 0,
      currentPageNo: 1,
      currentPageSize: 10,
      columns1: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        { title: '业务编号', key: 'Row_ID', width: 250, align: 'center' },
        { title: '事项名称', key: 'QL_NAME', width: 300, align: 'center' },
        {
          title: '办事类型',
          key: 'service_type',
          width: 300,
          align: 'center',
          render: (h, params) => {
            let val = params.row.service_type
            if (val === 'seal') {
              val = '盖章证明'
            } else if (val === 'internet') {
              val = '网办'
            } else if (val === 'general') {
              val = '通办'
            }
            return h('span', val)
          }
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'nopadding',
          minWidth: 100,
          render: (h, params) => {
            let temp = []
            temp.push(
              h('Button', {
                props: { type: 'primary', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.count = ''
                    this.modal = true
                    this.paramData = params.row
                    if (params.row.matchingcondition !== undefined) {
                      this.count = params.row.matchingcondition.split(',')
                    }
                  }
                }
              }, '编辑'),
              h('Button', {
                props: { type: 'info', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.modal1 = true
                    this.paramData = params.row
                  }
                }
              }, '详情'),
              h('Button', {
                props: { type: 'info', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.modal2 = true
                    this.paramskImg = params.row.FILEURL
                  }
                }
              }, 'PDF')
            )
            return h('div', temp)
          }
        }
      ],
      columns2: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        {
          title: '社区账号',
          key: 'company_code',
          width: 220,
          align: 'center',
          render: (h, params) => {
            let str = params.row.company_code
            if (params.row.company_name) {
              str += '（' + params.row.company_name + '）'
            }
            return h('span', str)
          }
        },
        { title: '模板id', key: 'template_id', width: 220, align: 'center' },
        { title: '模板名称', key: 'template_name', width: 220, align: 'center' },
        { title: '社区名称', key: 'issue_unitname', width: 220, align: 'center' },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'nopadding',
          minWidth: 80,
          render: (h, params) => {
            let temp = []
            temp.push(
              h('Button', {
                props: { type: 'primary', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.paramData1.company_code = ''
                    this.paramData1.id = params.row.id
                    this.visaModal = true
                  }
                }
              }, '更新')
            )
            return h('div', temp)
          }
        }
      ],
      columns3: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        {
          title: '社区账号',
          key: 'company_code',
          width: 220,
          align: 'center',
          render: (h, params) => {
            let str = params.row.company_code
            if (params.row.company_name) {
              str += '（' + params.row.company_name + '）'
            }
            return h('span', str)
          }
        },
        { title: '社区名称', key: 'sqmc', width: 220, align: 'center' },
        { title: '单位编号', key: 'dwbh', width: 220, align: 'center' },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'nopadding',
          minWidth: 80,
          render: (h, params) => {
            let temp = []
            temp.push(
              h('Button', {
                props: { type: 'primary', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.paramData2.company_code = ''
                    this.paramData2.id = params.row.id
                    this.yibaoModal = true
                  }
                }
              }, '更新')
            )
            return h('div', temp)
          }
        }
      ],
      columns5: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        {
          title: '社区账号',
          key: 'company_code',
          width: 220,
          align: 'center',
          render: (h, params) => {
            let str = params.row.company_code
            if (params.row.company_name) {
              str += '（' + params.row.company_name + '）'
            }
            return h('span', str)
          }
        },
        { title: '社区名称', key: 'sqmc', width: 220, align: 'center' },
        { title: '单位编号', key: 'dwbh', width: 220, align: 'center' },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'nopadding',
          minWidth: 80,
          render: (h, params) => {
            let temp = []
            temp.push(
              h('Button', {
                props: { type: 'primary', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.paramData3.company_code = ''
                    this.paramData3.id = params.row.id
                    this.rensheModal = true
                  }
                }
              }, '更新')
            )
            return h('div', temp)
          }
        }
      ],
      columns4: [
        { title: '序号', type: 'index', width: 70, align: 'center' },
        { title: '事项名称', slot: 'name' },
        { title: '事项编号', key: 'item_code_new', width: 260, align: 'center' },
        { title: '最新版本', key: 'version_new', width: 100, align: 'center' },
        { title: '获取时间', key: 'create_time', width: 170, align: 'center' },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          className: 'nopadding',
          width: 170,
          render: (h, params) => {
            let temp = []
            if (params.row.item_code) {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px' },
                  on: {
                    click: () => {
                      this.itemInfoCompare(params.row)
                    }
                  }
                }, '更新对比')
              )
              temp.push(
                h('Button', {
                  props: { type: 'primary', size: 'small' },
                  style: { marginRight: '5px' },
                  on: {
                    click: () => {
                      this.updateItemInfo(params.row, false)
                    }
                  }
                }, '更新')
              )
            } else {
              temp.push(
                h('Button', {
                  props: { type: 'info', size: 'small' },
                  style: { marginRight: '5px' },
                  on: {
                    click: () => {
                      this.itemInfoCompare(params.row)
                    }
                  }
                }, '事项详情')
              )
              temp.push(
                h('Button', {
                  props: { type: 'success', size: 'small' },
                  style: { marginRight: '5px' },
                  on: {
                    click: () => {
                      this.updateItemInfo(params.row, false)
                    }
                  }
                }, '添加')
              )
            }
            return h('div', temp)
          }
        }
      ],
      columnsCompare: [
        { title: '新信息', slot: 'compareNew', align: 'right' },
        { title: '对比值', key: 'key', width: 100, align: 'center' },
        { title: '原信息', slot: 'compareOld', align: 'left' }
      ],
      compareDict: {
        'a1': '是',
        'a0': '否',
        'state1': '在用',
        'state2': '暂停',
        'state3': '取消',
        'blxs1': '窗口办理',
        'blxs2': '网上办理',
        'blxs3': '快递申请'
      },
      datalist: [],
      datalist2: [],
      datalist3: [],
      datalist4: [],
      datalist5: [],
      count: [],
      itemInfoAll: []
    }
  },
  computed: {
    companyCode () {
      return this.$store.state.user.severUserInfo.company_code
    }
  },
  methods: {
    // 点击上面的tab标签页时候
    clickTabs () {
      if (this.tabIndex === 3) {
        this.searchData3()
      }
    },
    // 查询订单列表接口
    init (param) {
      param.pageNo = this.currentPageNo
      param.pageSize = this.currentPageSize
      itemList(param).then(res => {
        if (res.data.errcode === 0) {
          this.datalist = res.data.data.results
          this.totalnum = res.data.data.totalRecord
        } else {
          this.$Notice.error({ title: '获取事项列表失败', desc: res.data.errmsg })
        }
      })
    },
    // 事项信息配置数据列表
    searchData (index) {
      let params = {
        Row_ID: this.searchInfo.Row_ID,
        QL_NAME: this.searchInfo.QL_NAME
      }
      this.currentPageNo = 1
      this.init(params)
    },
    // 电子证照数据列表
    searchData1 (index) {
      let param = {
        company_code: this.searchInfo.company_code1,
        issue_unitname: this.searchInfo.issue_unitname1
      }
      visalist(param).then(res => {
        if (res.data.errcode === 0) {
          this.datalist2 = res.data.data
        } else {
          this.$Notice.error({ title: '获取电子证照列表失败', desc: res.data.errmsg })
        }
      })
    },
    // 配置医保账号
    searchData2 (index) {
      let param = {
        company_code: this.searchInfo.company_code2,
        sqmc: this.searchInfo.sqmc2
      }
      yibaoList(param).then(res => {
        if (res.data.errcode === 0) {
          this.datalist3 = res.data.data
        } else {
          this.$Notice.error({ title: '获取社区列表失败', desc: res.data.errmsg })
        }
      })
    },
    // 配置人社账号
    searchData4 (index) {
      let param = {
        company_code: this.searchInfo.company_code2,
        sqmc: this.searchInfo.sqmc2
      }
      rensheList(param).then(res => {
        if (res.data.errcode === 0) {
          this.datalist5 = res.data.data
        } else {
          this.$Notice.error({ title: '获取社区列表失败', desc: res.data.errmsg })
        }
      })
    },
    // 事项更新列表
    searchData3 () {
      itemUpdateList({ name: this.searchInfo.ql_name3 }).then(res => {
        if (res.data.errcode === 0) {
          this.datalist4 = res.data.data
        } else {
          this.$Notice.error({ title: '加载事项更新列表失败', desc: res.data.errmsg })
        }
      })
    },
    itemInfoCompare (obj) {
      let param = {
        item_code: obj.item_code_new,
        version: obj.version_new
      }
      this.itemupdateModal = true
      getItemUpdateInfo(param).then(res => {
        if (res.data.errcode === 0) {
          this.itemInfoAll = []
          let temp = res.data.data
          this.itemInfoAll.push({ id: 0, key: '名称', new: temp.ql_name, old: temp.ql_name_old })
          this.itemInfoAll.push({ id: 1, key: '编号', new: temp.item_code, old: temp.item_code_old })
          this.itemInfoAll.push({ id: 2, key: '版本', new: temp.version, old: temp.version_old })
          this.itemInfoAll.push({ id: 3, key: '事项状态', new: this.compareDict['state' + temp.ql_state], old: this.compareDict['state' + temp.ql_state_old] })
          this.itemInfoAll.push({ id: 4, key: '是否收费', new: this.compareDict['a' + temp.charge_flag], old: this.compareDict['a' + temp.charge_flag_old] })
          this.itemInfoAll.push({ id: 5, key: '受理机构', new: temp.sljg, old: temp.sljg_old })
          this.itemInfoAll.push({ id: 6, key: '办理形式', new: this.compareDict['blxs' + temp.blxs], old: this.compareDict['blxs' + temp.blxs_old] })
          this.itemInfoAll.push({ id: 7, key: '咨询方式', new: temp.link_tel, old: temp.link_tel_old })
          this.itemInfoAll.push({ id: 8, key: '办理地址', new: temp.accept_address, old: temp.accept_address_old })
          this.itemInfoAll.push({ id: 9, key: '工作时间', new: temp.accept_time, old: temp.accept_time_old })
          this.itemInfoAll.push({ id: 10, key: '受理条件', new: temp.apply_condition, old: temp.apply_condition_old })
          this.itemInfoAll.push({
            id: 11,
            key: '承诺时限',
            new: temp.promise_day === -1 ? '即办件' : temp.promise_day + '个工作日',
            old: temp.promise_day_old ? temp.promise_day_old === -1 ? '即办件' : temp.promise_day_old + '个工作日' : null
          })
          this.itemInfoAll.push({ id: 12, key: '时限说明', new: temp.sxsm, old: temp.sxsm_old })
          this.itemInfoAll.push({ id: 13, key: '要件', new: temp.docmentnew, old: temp.docmentold })
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    change (pageNo) {
      this.currentPageNo = pageNo
      let params = {
        Row_ID: this.searchInfo.Row_ID,
        QL_NAME: this.searchInfo.QL_NAME
      }
      this.init(params)
    },
    // 上传提示
    // upload () {
    //   this.loadingStatus = true
    //   setTimeout(() => {
    //     this.file = null
    //     this.loadingStatus = false
    //     this.$Message.success('上传成功')
    //   }, 1500)
    // },
    uploadFile (res) {
      this.paramData.FILEURL = res.url
    },
    // 文件格式
    handleFormatError (file) {
      this.$Notice.warning({
        title: '文件格式错误',
        desc: '文件 ' + file.name + ' 不正确，请选择pdf、png、jpg、doc格式文件'
      })
    },
    // 文件大小
    handleMaxSize (file) {
      this.$Notice.warning({
        title: '文件大小超出限制',
        desc: '文件  ' + file.name + ' 不能超过10M。'
      })
    },
    // 编辑基本信息
    Edit (paramData) {
      if (this.count.length !== 0) {
        this.paramData.matchingcondition = this.count.join(',')
      }
      saveItem(paramData).then(res => {
        this.init(this.params)
        if (res.data.data) {
          this.$Notice.success({ title: '修改成功', desc: '' })
        } else {
          this.$Notice.error({ title: '修改失败', desc: res.data.errmsg })
        }
      })
    },
    updateVisaInfo (item) {
      var param = {
        id: this.paramData1.id,
        company_code: this.paramData1.company_code
      }
      updateVisa(param).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '成功', desc: '更新电子证照成功' })
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg
          })
        }
      })
    },
    updateYibaoInfo (item) {
      var param = {
        id: this.paramData2.id,
        company_code: this.paramData2.company_code
      }
      updateYibao(param).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '成功', desc: '医保账号配置成功' })
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    updateRensheInfo (item) {
      var param = {
        id: this.paramData3.id,
        company_code: this.paramData3.company_code
      }
      updateRenshe(param).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '成功', desc: '医保账号配置成功' })
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    // 对比事项信息后更新事项
    updateItemInfo (obj, seeInfo) {
      let para = {}
      if (seeInfo) {
        para.item_code = obj[1].new
        para.version = obj[2].new
      } else {
        para.item_code = obj.item_code_new
        para.version = obj.version_new
      }
      updateItem(para).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '成功', desc: '事项更新成功' })
          this.searchData3()
        } else {
          this.$Notice.error({ title: '失败', desc: res.data.errmsg })
        }
      })
    },
    handleClose2 (event, name) {
      const index = this.count.indexOf(name)
      this.count.splice(index, 1)
    }
  },
  filters: {
    type_cn: function (value) {
      if (value === 'seal') {
        return '盖章证明'
      } else if (value === 'internet') {
        return '网办'
      } else if (value === 'general') {
        return '通办'
      }
    }
  },
  mounted () {
    this.init({})
  }
}
</script>
